(set! geometry-lattice (make lattice (size 16 16 no-size)))

(define (range low high step)
	(cond
	((> low high) (list))
	(else (cons low (range (+ low step) high step)))))

(define bare_ground (list
	(make block (center 0 -6) (size 16 4 infinity)
	(material (make medium (epsilon 3.4)
	(D-conductivity (/ (* 2 pi 0.42 0.101) 3.4)))))))



(define (trunk x)
		(make block (center x -1) (size 1 6 infinity)
		(material (make dielectric (epsilon 12)))))

(define (canopy x)
		(list
		(make block (center x -2) (size 4 1 infinity)
                      (material (make dielectric (epsilon 12))))
		(make block (center x -1) (size 3 1 infinity)
                      (material (make dielectric (epsilon 12))))
		(make block (center x 0) (size 2 2 infinity)
                      (material (make dielectric (epsilon 12))))))

(define (tree x) (append (canopy x) (trunk x)))

(set! geometry (append
		bare_ground
		(map tree (range -4 4 2))))	
		

(set! pml-layers (list (make pml (thickness 1.0))))
(set! resolution 10)

(set! sources (list
               (make source
                 (src (make continuous-src
                        (wavelength (* 2 (sqrt 12))) (width 20)))
                 (component Ez)
                 (center -7 5.5) (size 0 1))))

(run-until 200
           (at-beginning output-epsilon)
           (to-appended "ez" (at-every 0.6 output-efield-z)))



